{% extends "myadmin/base.html" %}

{% block mainbody %}                
    <form id="edit-profile" action="{% url 'myadmin_users_update' user.id %}" class="form-horizontal" method="post">
        {% csrf_token %}
        <fieldset>
            <h3 style="font-size: 28px"><legend>编辑会员信息</legend></h3>
            <div class="control-group">
                <label class="control-label" for="input01">账号：</label>
                <div class="controls">
                    {{ user.username }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">真实姓名：</label>
                <div class="controls">
                    {{ user.name }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">性别：</label>
                <div class="controls">
                    {% if user.sex == 1 %}
                        <input type="radio" name="sex" class="input-xlarge" id="input01" value="1" checked /> 男
                    {% endif %}
                    {% if user.sex == 0 %}
                        <input type="radio" name="sex" class="input-xlarge" id="input01" value="0" checked /> 女
                    {% endif %}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">地址：</label>
                <div class="controls">
                    {{ user.address }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">邮编：</label>
                <div class="controls">
                    {{ user.code }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">电话：</label>
                <div class="controls">
                    {{ user.phone }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">email邮箱：</label>
                <div class="controls">
                    {{ user.email }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="input01">状态：</label>
                <div class="controls">
                    <input type="radio" name="state" class="input-xlarge" id="input01" value="0" 
                    {% if user.state == 0 %}checked{% endif %} /> 管理员 
                    <input type="radio" name="state" class="input-xlarge" id="input01" value="1" 
                    {% if user.state == 1 %}checked{% endif %} /> 启用会员
                    <input type="radio" name="state" class="input-xlarge" id="input01" value="2" 
                    {% if user.state == 2 %}checked{% endif %} /> 禁用用户
                </div>
            </div>  
            <div class="control-group">
                <label class="control-label" for="input01">密码：</label>
                <div class="controls">
                    {{ user.password }}
                </div>
            </div>                      
            <div class="form-actions">
                <button type="submit" class="btn btn-primary" style="margin-left: -30px">保存</button> <button type="reset" class="btn" style="margin-left: 25px">重置</button>
            </div>
        </fieldset>
    </form>
{% endblock %}
